package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-11-22
 * Time: 16:47
 */

class Shape{
    public void draw(){
        System.out.println("画图形");
    }
}
class Cycle extends Shape{
    public void draw(){
        System.out.println("o");
    }
}
class Rect extends Shape{
    public void draw(){
        System.out.println("矩形");
    }
}

public class Test3 {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        drawMap(new Rect());
        drawMap(new Cycle());
    }
}
